<template>
  <div>我是孙子组件 x:{{ x }} y:{{ y }}</div>
  <div>钱：{{ money }}</div>
  <div><button @click="updateMoney">花爷爷的钱</button></div>
</template>
<script setup lang="ts">
import { inject } from 'vue'

const { money, updateMoney } = inject('dollar', { money: 0, updateMoney: () => {} })
defineProps(['x', 'y'])
</script>

<style lang="scss" scoped></style>
